import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';

import '../util/_base_export.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import '../generated/l10n.dart';

class App {
  static FluroRouter router=new FluroRouter();
}

class AppString extends S {
  static of(BuildContext context) {
    return S.current;
  }
}

class AppConfig {
  static String mode = 'P';
  static String? version = AppSession.packageInfo.version; //'0.0.1';
  // static String patch = '200103';
  // static int appid = 1;
  // static String tkkey = '6275D73VJR1QJBB6DS3ZGHPQSR';

  static Map constsIos = {
    'channel': 1,
    'store_url': 'https://apps.apple.com/ca/app/id1505389946?ls=1',
  };
  static Map constsAndroid = {
    'channel': 2,
    'store_url': 'https://play.google.com/store/apps/details?id=ca.tudouapp.app',
    'dl_url': 'https://www.tudouapp.ca/app/app-release.apk',
  };
}

class App3rdKey {
  // static String stripe_key = 'pk_live_XQlHKvkQ8N9yPEHlslQvaS7U';
  static String stripe_key = 'pk_live_SztpKHIndBJ2idvDkSnaqoB700EuWKU5BA';
  static String applepay_id = "merchant.ca.chanmao.applypay";
  static String googlemap_key = "AIzaSyDm0bF_bjpEue3XwywDxx5_2J67jdIF6FU";

  static String intercom_appid = "jvdlf038";
  static String intercom_ios = "ios_sdk-855a5e020b994f0bd4cfbd52c0176cc02bc0aa6a";
  static String intercom_android = "android_sdk-a69e33d3aae6224e033d308924a1827ec57210ca";

  static String wechat_appid = 'wxbdc41f2a0d54d313';
  static String wechat_ulink = 'https://www.tudouapp.ca/ulink/';
  //
  // static String google_key = 'AIzaSyDTkNX2EIqMmcH2Zy2OlPkgZROPGM4db1c';
}

class AppFont {
  static String en = "ProximaNova";
  static String zh = "NotoSans";
}

class AppConst {
  static int connectTimeout = 10000;
  static int receiveTimeout = 10000;
  static int prodQueryPagesize = 10;
  static int prodQueryMax = 10000;
  static int orderHistPagesize = 5;
  static int maxDuration = 5;
  static String term_url = 'https://sites.google.com/view/tudouapp';
}

class AppScreen {
  static double initWidth = 375;
  static double initHeight = 812;
}

class AppLocalkey {
  static String merchantCode = 'merchant_code';
  static String merchantLogo = 'merchant_logo';
  static String authortoken = 'authortoken';
  static String fbToken = 'fb_token';
  static String tokenRefreshedAt = 'token_refreshed_at';
  static String langCode = 'lang_code';
  static String langCountry = 'lang_country';
}

class AppColor {
  static Color greyBg = Color(0xffF4F4F4);
  static Color greyText = Color(0xff4E4E4E);

  static Color yellowText = Color(0xffFF9F05);
  static Color bgOne = Color(0xffF8F8F8);
  static Color bgBottomBar = Color(0xffF8F8F8);
  static Color textBottomBar = Color(0xff808080);
  static Color textOrder = Color(0xffFF9F05);
  static Color priceProduct = Color(0xffFF9F05);
  static Color nameProduct = Color(0xff000000);
  static Color descProduct = Color(0xff808080);
  static Color yellowMain = Color(0xffFFB91A);
  static Color blackMain = Color(0xff000000);
  static Color blueMain = Color(0xff4F7BFC);
  static Color redMain = Color(0xffFF3434);

  static Color wechatLogin = Color(0xff37CA23);

  static getOrderColor(int iv_status) {
    Color ev_color;
    switch (iv_status) {
      case 0:
        ev_color = Color(0xffFF3434);
        break;
      case 10:
        ev_color = Color(0xffFF9F05);
        break;
      case 20:
        ev_color = Color(0xffFF9F05);
        break;
      case 30:
        ev_color = Color(0xff26CE8D);
        break;
      case 40:
        ev_color = Color(0xff149AFC);
        break;
      case 90:
        ev_color = Color(0xff000000);
        break;
      default:
        ev_color = Color(0xff000000);
    }
    return ev_color;
  }
}

// class AppPopup {
//   static int bottomPopupDuration = 3;
// }

class AppInput {
  static OutlineInputBorder loginInputBorder = OutlineInputBorder(
    borderSide: BorderSide(
      color: Color.fromARGB(255, 198, 154, 84),
      style: BorderStyle.solid,
    ),
    borderRadius: BorderRadius.all(Radius.circular(25)),
  );
  // static OutlineInputBorder loginInputBorder2 = OutlineInputBorder(
  //   borderSide: BorderSide(
  //     color: Colors.transparent,
  //     style: BorderStyle.none,
  //   ),
  //   borderRadius: BorderRadius.all(Radius.circular(25)),
  //   gapPadding: 0,
  // );
}

class AppWidget {
  // static AppBar PDAppBar = AppBar(

  // );

}

class AppDecoration {
  // static OutlineInputBorder loginInputBorder = OutlineInputBorder(
  //   borderSide: BorderSide(
  //     color: Color.fromARGB(255, 198, 154, 84),
  //     style: BorderStyle.solid,
  //   ),
  //   borderRadius: BorderRadius.all(Radius.circular(25)),
  // );

  static BoxDecoration buttonOne = BoxDecoration(
    color: AppColor.yellowText,
    border: Border.fromBorderSide(BorderSide(
      color: AppColor.yellowMain,
      width: 1,
      style: BorderStyle.solid,
    )),
    borderRadius: BorderRadius.all(Radius.circular(30)),
  );

  static BoxDecoration buttonLoginWechat = BoxDecoration(
    color: AppColor.wechatLogin,
    border: Border.fromBorderSide(BorderSide(
      color: AppColor.wechatLogin,
      width: 1,
      style: BorderStyle.solid,
    )),
    borderRadius: BorderRadius.all(Radius.circular(30)),
  );

  // static BoxDecoration buttonTwo = BoxDecoration(
  //   color: Color.fromARGB(255, 255, 255, 255),
  //   boxShadow: [
  //     BoxShadow(
  //       color: Color.fromARGB(41, 0, 0, 0),
  //       offset: Offset(0, 3),
  //       blurRadius: 6,
  //     ),
  //   ],
  //   borderRadius: BorderRadius.all(Radius.circular(25)),
  // );

  // static BoxDecoration buttonMemberEnroll = BoxDecoration(
  //   color: Colors.blue,
  //   boxShadow: [
  //     BoxShadow(
  //       color: Color.fromARGB(41, 0, 0, 0),
  //       offset: Offset(0, 3),
  //       blurRadius: 6,
  //     ),
  //   ],
  //   borderRadius: BorderRadius.all(Radius.circular(25)),
  // );

  // static BoxDecoration inputProfile = BoxDecoration(
  //   color: Colors.white,
  //   border: Border.fromBorderSide(BorderSide(
  //     color: AppColor.goldenOne,
  //     width: 1,
  //     style: BorderStyle.solid,
  //   )),
  //   borderRadius: BorderRadius.all(Radius.circular(10)),
  // );

  // static BoxDecoration inputProfileReadOny = BoxDecoration(
  //   color: Colors.grey,
  //   border: Border.fromBorderSide(BorderSide(
  //     color: AppColor.goldenOne,
  //     width: 1,
  //     style: BorderStyle.solid,
  //   )),
  //   borderRadius: BorderRadius.all(Radius.circular(10)),
  // );
}
